package com.newlink.building.userinfo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.newlink.building.userinfo.R
import com.newlink.building.userinfo.bean.Module_UserInfo_CallSettingCallPreferenceDialogBean

/**
 * @author wangyang
 * @date 2022/10/17
 * @description 我的——通话设置——呼叫偏好页面的Adapter
 */
class Module_UserInfo_CallSettingCallPreferenceAdapter(data: ArrayList<Module_UserInfo_CallSettingCallPreferenceDialogBean>) :
    BaseQuickAdapter<Module_UserInfo_CallSettingCallPreferenceDialogBean, BaseViewHolder>(
        R.layout.item_call_setting_call_preference,
        data
    ) {

    override fun convert(holder: BaseViewHolder, item: Module_UserInfo_CallSettingCallPreferenceDialogBean) {
        holder.setText(R.id.tv_name, item.name)
        holder.setText(R.id.tv_number, item.content)

        val position = holder.layoutPosition;
        if (position == 9) {
            holder.setGone(R.id.view, true)
        } else {
            holder.setVisible(R.id.view, true)
        }
    }
}